package com.raos.mongo.demo.dao;

import com.raos.mongo.demo.entity.Hotel;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import javax.core.common.mongo.BaseDaoSupport;
import java.util.List;

/**
 * Hotel 持久层
 *
 * @author raos
 * @emil 991207823@qq.com
 * @date 2021/8/30 22:02
 */
@Repository
public class HotelDao extends BaseDaoSupport<Hotel, Long> {

	@Override
	protected String getPKColumn() { return "id"; }

	@Resource(name="mongoTemplate")
	protected void setTemplate(MongoTemplate template) {
		super.setTemplate(template);
	}
	
	public List<Hotel> getAll(){
		return super.getAll();
	}
	
	public void insert(Hotel entity){
		super.insert(entity);
	}

}
